import datetime


class Answer:
    def __init__(self,
                 answerID: int = None,
                 answer_content: str = None,
                 answer_time: datetime = None,
                 answer_file_path: str = None,
                 answer_file_size: int = None,
                 review_content: str = None,
                 review_time: datetime = None,
                 review_file_path: str = None,
                 review_file_size: int = None,
                 status: int = None,  # 未提交：0；已提交：1；已批改：2
                 userID: str = None,
                 homeworkID: int = None):
        self.answerID = answerID
        self.answer_content = answer_content
        self.answer_time = answer_time
        self.answer_file_path = answer_file_path
        self.answer_file_size = answer_file_size
        self.review_content = review_content
        self.review_time = review_time
        self.review_file_path = review_file_path
        self.review_file_size = review_file_size
        self.status = status
        self.userID = userID
        self.homeworkID = homeworkID

    def to_string(self):
        return "answerID: {}, answer_content: {}, answer_time: {}, answer_file_path: {}, answer_file_size: {}, ".format(
            self.answerID, self.answer_content, self.answer_time, self.answer_file_path, self.answer_file_size) + \
               "review_content: {}, review_time: {}, review_file_path: {}, review_file_size: {}, ".format(
            self.review_content, self.review_time, self.review_file_path, self.review_file_size) + \
               "status: {}, userID: {}, homeworkID: {}".format(
            self.status, self.userID, self.homeworkID)
